import React from "react";
import PropTypes from "prop-types";
function HeaderFunChild({ count = 99, changeCount }) {
  return (
    <div>
      <h1>HeaderFunChild:函数组件</h1>
      <div>count:{count}</div>
      <p>
        <button onClick={() => changeCount(4)}>子组件改变父组件的state </button>
      </p>
    </div>
  );
}

HeaderFunChild.propTypes = {
  count: PropTypes.number,
  changeCount: PropTypes.func.isRequired,
};

export default HeaderFunChild;
